package at.fhooe.im440.pandora.visuals;

import java.awt.Graphics2D;
import java.awt.geom.Point2D;

public class Stroke extends Visual {
	
	private int len;
	private int startX;
	private int startY;
	private int endX;
	private int endY;
	private double rotation;

	public Stroke(int len, int x, int y) {
		this.len = len;
		this.startX = x;
		this.startY = y;
		
		this.rotation = Math.toRadians(3);
	}

	@Override
	public void update() {
		rotation -=  Math.toRadians(3);
		double x = startX + len*Math.cos(rotation);
		double y = startY + len*Math.sin(rotation);
		
		endX = (int) x;
		endY = (int) y;
	}

	@Override
	public void draw(Graphics2D g) {
		// TODO Auto-generated method stub
		g.drawLine(startX, startY, (int) endX, (int) endY);
	}

}
